package com.veng.springbootdemo.rabbit;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TopicRabbitSender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendFirst(String message){
        rabbitTemplate.convertAndSend("topicExchange","topic.first",message);
    }

    public void sendSecond(String message){
        rabbitTemplate.convertAndSend("topicExchange","topic.second",message);
    }
}
